package com.hwz.hwzliving.commodity.entity;

import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import java.io.Serializable;
import java.util.Date;

import com.hwz.common.group.SaveGroup;
import com.hwz.common.group.UpdateGroup;
import com.hwz.common.validator.MyValidator.EnumValidate;
import lombok.Data;
import org.hibernate.validator.constraints.URL;

import javax.validation.constraints.*;

/**
 * 家居品牌
 * 
 * @author hwz
 * @email hwz@gmail.com
 * @date 2024-06-13 10:04:36
 */
@Data
@TableName("commodity_brand")
public class BrandEntity implements Serializable {
	private static final long serialVersionUID = 1L;

	/**
	 * id
	 */
	@TableId
	@NotNull(message = "修改数据必须带id", groups = {UpdateGroup.class})
	@Null(message = "提交数据不能带id", groups = {SaveGroup.class})
	private Long id;
	/**
	 * 品牌名
	 */
	@NotBlank(message = "品牌名不能为空", groups = {SaveGroup.class,UpdateGroup.class})
	private String name;
	/**
	 * logo
	 */
	@NotBlank(message = "logo不能为空")
	@URL(message = "logo不符合url格式",groups = {SaveGroup.class, UpdateGroup.class})
	private String logo;
	/**
	 * 说明
	 */
	private String description;
	/**
	 * 显示
	 */
	@NotNull(message = "显示不能为空",groups = {SaveGroup.class, UpdateGroup.class})
	@EnumValidate(values = {0,1}, groups = {SaveGroup.class, UpdateGroup.class})
	private Integer isshow;
	/**
	 * 检索首字母
	 */
	@NotBlank(message = "检索首字母不能为空", groups = {SaveGroup.class})
	@Pattern(regexp = "^[a-zA-Z]$", message = "检索字母必须为a-z或者A-Z")
	private String firstLetter;
	/**
	 * 排序
	 */
	@NotNull(message = "排序不能为空", groups = {SaveGroup.class})
	@Min(value = 0, message = "排序必须大于0")
	private Integer sort;

}
